name: "Deep Classifier: Scraper"

permissions:
  id-token: write
  contents: read

on:
  schedule:
    - cron: 0 0 15 * * # 15th of the month
  workflow_dispatch:
  repository_dispatch:
    types: [trigger-deep-classifier-scraper]

jobs:
  main:
    runs-on: ubuntu-latest
    environment: main
    steps:
      - uses: azure/login@v2
        with:
          client-id: ${{ vars.AZURE_CLIENT_ID }}
          tenant-id: ${{ vars.AZURE_TENANT_ID }}
          allow-no-subscriptions: true
      - name: Checkout Actions
        uses: actions/checkout@v4
        with:
          repository: "microsoft/vscode-github-triage-actions"
          ref: stable
          path: ./actions
      - name: Install Actions
        run: npm install --production --prefix ./actions
      - name: Install Additional Dependencies
        # Pulls in a bunch of other packages that arent needed for the rest of the actions
        run: npm install @azure/storage-blob@12.1.1
      - name: "Run Classifier: Scraper"
        uses: ./actions/classifier-deep/train/fetch-issues
        with:
          blobContainerName: vscode-issue-classifier
          token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
